package com.le.basic.recur;

public class Code_02_printAllSequences {
    public static void printSequence(char[] chs, int i, String res) {
        if (i == chs.length) {
            System.out.println(res);
            return;
        }
        printSequence(chs, i + 1, res);
        printSequence(chs, i + 1, res + chs[i]);
    }

    public static void main(String[] args) {
        String str = "abc";
        printSequence(str.toCharArray(), 0, "");
    }
}
